import 'package:flutter_pickers/time_picker/model/pduration.dart';

class TimeZeroComplement {
  String year;
  String month;
  String day;
  String hour;
  String minute;
  String second;

  TimeZeroComplement(PDuration data){
    this.year = data.year.toString();
    this.month = data.month<=9?'0'+data.month.toString():data.month.toString();
    this.day = data.day<=9?'0'+data.day.toString():data.day.toString();
    this.hour = data.hour<=9?'0'+data.hour.toString():data.hour.toString();
    this.minute = data.minute<=9?'0'+data.minute.toString():data.minute.toString();
    this.second = data.second<=9?'0'+data.second.toString():data.second.toString();
  }

  String format() => '$year-$month-$day $hour:$minute:$second';

  @override
  String toString() {
    return 'Aa{year: $year, month: $month, day: $day, hour: $hour, minute: $minute, second: $second}';
  }
}